import request from '@/utils/request'
const baseURL_company = '/company'
const baseURL_authentication = '/company/authentication'
const baseURL_category = '/company/category'
export default {
  // 认证用户
  authUser(data) {
    return request({
      url: baseURL_company + '/auth',
      method: 'POST',
      data
    })
  },
  isAuth(data) {
    return request({
      url: baseURL_authentication,
      method: 'POST',
      data
    })
  },
  authCompany(data) {
    return request({
      url: baseURL_company + '/authCompany',
      method: 'POST',
      data
    })
  },
  getCompanyById(companyId) {
    return request({
      url: baseURL_company + '/' + companyId,
      method: 'GET'
    })
  },
  getAuthNumber(companyId) {
    return request({
      url: baseURL_authentication + '/authNumber',
      method: 'GET',
      params: {
        companyId
      }
    })
  },
  getCategoryName(categoryId) {
    return request({
      url: baseURL_category + '/getCategoryName',
      method: 'POST',
      data: categoryId
    })
  },
  getCategoryList() {
    return request({
      url: baseURL_category + '/get/all',
      method: 'GET'
    })
  },
  updateProfile(companyId, profilePicture) {
    return request({
      url: baseURL_company + '/update/profile',
      method: 'POST',
      params: {
        companyId,
        profilePicture
      }
    })
  },
  updateCompany(data) {
    return request({
      url: baseURL_company + '/update/company',
      method: 'POST',
      data
    })
  },
  getCount(companyId) {
    return request({
      url: baseURL_company + '/posts/boss/count',
      method: 'GET',
      params: {
        companyId
      }
    })
  }
}
